<!doctype html> 
<html> 
<head> 
    <meta charset="utf-8"> 
    <title></title> 
</head>
<body>
<input type='text' id='k'>
<input type='checkbox' id='t'>
<script type="text/javascript">

//console.log(new Date().getTime())
	if(localStorage.mess){
		var nowTime = new Date().getTime() - localStorage.time;

		console.log(nowTime)
		var day = parseInt(nowTime/1000/60/60/24);//
		if(day>7){
			localStorage.mess = null;
			localStorage.time = null;
		}
		else{
			k.value = localStorage.mess;
		}
	}

	t.onclick = function(){
		if(this.checked){
			localStorage.mess = k.value;
			localStorage.time = new Date().getTime();
		}

	};

	//localStorage.a = 10;	
	//alert(localStorage.a)
	//alert(a);
</script>
</body>
</html>